﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormProject.Personel
{
    public partial class UserListesi : Form
    {
        public UserListesi()
        {
            InitializeComponent();
        }

        DBBaglantiDataContext db = new DBBaglantiDataContext();
        public Form AcanForm = null;
        private void UserListesi_Load(object sender, EventArgs e)
        {
            GrdUserList.DataSource = (from x in db.aspnet_Memberships join y in db.aspnet_Users on x.UserId equals y.UserId select new { x.UserId, y.UserName }).ToList();
        }

        private void GrdUserList_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (AcanForm.Name == "Personelfrm")
            {
                Personelfrm frm = Application.OpenForms["Personelfrm"] as Personelfrm;
                 if (frm != null)
                {
                   frm.UserID.Text = GrdUserList.Rows[e.RowIndex].Cells[0].Value.ToString();
                     this.Close();

                 }
            
            }
        }
    }
}
 